import Vue from 'vue'
import validate from '@/utils/validate'
import copyText from '@/utils/copyText'
import storage from '@/utils/storage'
import countDown from '@/utils/countDown'
import dataDealer from '@/utils/dataDealer'
import createInputFile from '@/utils/uploadLocal'
import { downloadFile } from '@/utils/download'
import { sortAlphabet } from '@/utils/sortAlphabet'
import { isSelf } from '@/utils/identification'
import time from '@/utils/time'
import getAvatar from '@/utils/getAvatar'
import isFriend from '@/utils/isFriend'
import getContactInfo from '@/utils/getContactInfo'
import conference from '@/utils/conference'
import webRTC from '@/utils/webRTC'
import unload from '@/utils/unload'
import getUserId from './getUserId'

class Tools {
  constructor () {
    this.validate = validate
    this.copyText = copyText
    this.storage = storage
    this.countDown = countDown
    this.dataDealer = dataDealer
    this.createInputFile = createInputFile
    this.download = downloadFile
    this.sortAlphabet = sortAlphabet
    this.isSelf = isSelf
    this.time = time
    this.getAvatar = getAvatar
    this.isFriend = isFriend
    this.getContactInfo = getContactInfo
    this.conference = conference
    this.webRTC = webRTC
    this.unload = unload
    this.getUserId = getUserId
  }
}
const tools = new Tools()
Vue.prototype.tools = tools
export default tools
